package com.pan.feign;

import com.pan.entity.Result;
import com.pan.feign.vo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.InvocationTargetException;

@FeignClient(url = "http://127.0.0.1:8000" ,name = "user-server")
public interface UserServerClient {
//
//    @PostMapping("/update/noCookie/{memberName}")
//    public <T> Result updateNoCookie(@RequestParam("userTicket") String userTicket,
//                                     @PathVariable String memberName,
//                                     @RequestParam T value);
    @ResponseBody
    @PostMapping("/user/update/noCookie/{memberName}/{userTicket}/{value}")
    public <T> Result updateNoCookie(@PathVariable("userTicket") String userTicket,
                                 @PathVariable String memberName,
                                 @PathVariable T value)
            throws NoSuchFieldException, InvocationTargetException, NoSuchMethodException, IllegalAccessException;
    @GetMapping("/user/select/id/{id}")
    public Result<UserVo> selectById(@PathVariable Long id);

}
